<?php
require_once ROOT_LIBRARY_UTILITY.DS. 'BaseController.php';
require_once ROOT_LIBRARY_UTILITY.DS. 'Globals.php';

require_once ROOT_APPLICATION_MODULE_BACKEND_MODELS.DS. 'Model_Partner.php';
require_once ROOT_APPLICATION_MODULE_BACKEND_MODELS.DS. 'Model_Project.php';
require_once ROOT_APPLICATION_MODULE_BACKEND_MODELS.DS. 'Model_Article.php';
require_once ROOT_APPLICATION_MODULE_BACKEND_MODELS.DS. 'Model_Account.php';

class IndexController extends BaseController{

	public function init(){
		parent::init();

	}

	public function indexAction(){
        try
        {
            //Get partner
            $mdPartner = new Model_Partner();
            $listPartners = $mdPartner->_getAll();
            $this->view->listPartners = $listPartners;

            //Get project
            $mdProject = new Model_Project();
            $listProjects = $mdProject->_getAll();
            $this->view->listProjects = $listProjects;

            //Get article
            $mdArticle = new Model_Article();
            $listNews = $mdArticle->_getAll("article_types_id = ".NEWS);
            $this->view->listNews = $listNews;

            $listKnowledges = $mdArticle->_getAll("article_types_id = ".KNOWLEDGES);
            $this->view->listKnowledges = $listKnowledges;
        }
        catch(Exception $ex)
        {
            
        }
	}


	public function viewAction(){


	}



}